<html>
    <head>
        <meta name="layout" content="main-layout"></meta>
        <link rel="stylesheet" href="${resource(dir:'css',file:'logs.css')}"></link>
        <link rel="stylesheet" href="${resource(dir:'css/jquery',file:'data_table.css')}"></link>
        <script type="text/javascript">
            var lastLogId = ${lastLogId};
        </script>
        <g:javascript src="logs.js" />
        <title>Logs Preview</title>
    </head>

    <body>
        <div>
            <div class="dataTables_wrapper" id="logs-table_wrapper">
                <div id="logs-loader-wrapper" class="fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix">
                    <img id="logs-loader" alt="Loading..." src="${resource(dir:'images',file:'ajax-loader.gif')}">
                </div>
                <table cellpadding="0" cellspacing="0" border="0" id="logs-table">
                    <thead>
                        <tr>
                            <th class="ui-state-default"><div class="DataTables_sort_wrapper header-wrapper agent-header">Agent ID</div></th>
                            <th class="ui-state-default"><div class="DataTables_sort_wrapper header-wrapper level-column">Level</div></th>
                            <th class="ui-state-default"><div class="DataTables_sort_wrapper header-wrapper date-column">Date</div></th>
                            <th class="ui-state-default"><div class="DataTables_sort_wrapper header-wrapper message-column">Message</div></th>
                            <th class="ui-state-default"><div class="DataTables_sort_wrapper header-wrapper class-column">Class Name</div></th>
                        </tr>
                    </thead>
                    <tbody>
                        <g:if test="${logs.size() > 0}">
                            <g:render template="logTemplate" collection="${logs}" />
                        </g:if>
                        <g:else>
                            <tr><td colspan="5"><span id="no-data">No logs to preview</span></td></tr>
                        </g:else>
                    </tbody>
                </table>
                <div class="fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix">
                    <div class="dataTables_info" id="logs-table_info">Showing <span id="logs-number">${logs.size()}</span> entries</div>
                </div>
           </div>
        </div>
    </body>
</html>
